from kivy.uix.floatlayout import FloatLayout

from play_layout import play_layout
from instruction_layout import instruction_layout
from freefall_layout import *

class animation_layout(  FloatLayout ):
    def __init__( self, custom_animation, **kargs ):
        super( animation_layout, self ).__init__( **kargs )

        play = play_layout( size_hint = ( 1.0, 0.05 ) )
        instruction = instruction_layout( 
            pos_hint = { 'x' : .0, 'y' : 0.05 },
            size_hint = ( 0.2, 0.95 ) )
            
        self.add_widget( play )
        self.add_widget( instruction )
        
        if custom_animation == 'freefall':
            custom_layout = freefall_layout( 
                pos_hint = { 'x' : 0.2, 'y' : 0.05 },
                size_hint = ( 0.8, 0.95 ) )
        
        self.add_widget( custom_layout )
        
if __name__ == '__main__':
    from kivy.app import App
    class testApp( App ):
        def build( self ):
            return animation_layout( 'freefall')
    testApp().run()